﻿<!doctype html>
<html>
<head>
    <title>微街秀 > 红包记录</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" type="text/css" href="css/css.css">
    <link rel="stylesheet" type="text/css" href="css/Makeresult.css">
    <link href="css/MakeAdvertMain.css" rel="stylesheet" type="text/css" />
    <script src="js/ajax-data.js" type="text/javascript"></script>
    <script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script src="js/dialog.js" type="text/javascript"></script>
</head>
<body>
    <div>
        <div class="wamtop">
            <div class="topcententxt">
                分享</div>
                        <div class="topright" style="color: white;" onClick="window.location.href='Makead_2.html'">
                 推广</div>
        </div>
         <div class="selectTags">
            <table class="tab">
                <tbody>
                    <tr>
                        <td>
                            <div class="model" id="Share" style="background-color: rgb(244, 244, 244);" onClick="window.location.href='makesh_1.html'">
                                <img src="img/Makeimg/newicon/1.png">
                                <div>
                                    红包分享
                                </div>
                                <div class="border">
                                </div>
                            </div>
                        </td>
                        <td>
                            <div class="model" id="effect" style="color: rgb(243, 123, 11); background-color: rgb(231, 231, 231);">
                                <img src="img/Makeimg/newicon/4.png">
                                <div>
                                    红包记录
                                </div>
                                   <div class="border" style="border-bottom-width: 2px;border-bottom-color: rgb(243, 123, 11);border-bottom-style: solid;">
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="model" id="pubsilh" style="background-color: rgb(244, 244, 244);" onClick="window.location.href='makesh_3.html'">
                                <img src="img/Makeimg/newicon/5.png">
                                <div>
                                    我的财富
                                </div>
                                <div class="border">
                                </div>
                            </div>
                        </td>
                        <td>
                            <div class="model" id="cost" style="background-color: rgb(244, 244, 244);" onClick="window.location.href='makesh_4.html'">
                                <img src="img/Makeimg/newicon/7.png">
                                <div>
                                    我的设置
                                </div>
                                <div class="border" style="">
                                </div>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="Tags">
            <div class="Tagtxt">
                红包记录</div>
                           <div class="numclass">
            <b class="sanjiao"></b>
            <div class="countnum">0条</div>
        </div>
       
        <div class="tg_select2">
        </div>
          <div class="tg_select1" style="margin-bottom:50px;">
        </div>
            <div class="bottom">
            <ul>
                <li>
                    <div onClick="window.location.href='index.html'">
                        <img src="img/tab1_g.png" /><br />
                        发现
                    </div>
                </li>
                <li>
                    <div onClick="window.location.href='publish.html'">
                        <img src="img/tab2_g.png" /><br />
                        发布
                    </div>
                </li>
                <li>
                     <div class="Defutalcolor" style=" position:relative;">
                        <img src="img/tab3_y.png" />
                        <br />
                        推广
                        <div class="newRed">
                        </div>
                    </div>
                </li>
                <li>
                    <div onClick="if(login())window.location.href = 'Personal.html'">
                        <img src="img/tab4_g.png" /><br />
                        我的
                    </div>
                </li>
            </ul>
        </div>
    </div>
    
    <script>
        var pagecount = "0", count_no = 0;
        var page = 1;
        var keyword = ""; //关键词

        $(document).ready(function () {
            load_no(page);
            load(page);
            $(window).bind("scroll", function () {
                //当滚动条滚动时
                var scollTop = $(this).scrollTop() + $(this).height();
                var scollH = $(document).height();
                if (scollH - scollTop < 100) {
                    if (wait.isShow) { return; } //如果正在加载，则返回
                    page++;
                    load(page);
                }
                return false;
            });
            $("#searchico").click(function () { $("#ws_tg").html(""); load(page) });
        });
        function load(page) {        
            if (pagecount == "1") { return; }
            if (!islogin()) { window.location.href = 'login.html'; return; }
            keyword = $("#Stext").val();
            AjaxStart("ajax/fc_shared.ashx?getlistshared", "&page_index=" + page, function (data) {
                if (data.code == "4") {
                    pagecount = "1";
                    setTimeout(function () {
                        if (count_no < 1)
                            Alert(data.msg.toString());                       
                    }, 1000);
                    return;
                }

                if (data.item.pageCount < page) {
                    if (pagecount == "0")
                        Alert('到底了！');
                    pagecount = "1"; return;
                }
                $(".countnum").html(count_no + data.item.itemCount + " 条");
                loadhtml(data.item.table, 1);
            });
        }

        function load_no(page) {
            if (pagecount == "1") { return; }
            if (!islogin()) { window.location.href = 'login.html'; return; }
            AjaxStart("ajax/fc_shared.ashx?getlistshared_no", "&page_index=" + page, function (data) {
                count_no = data.item.length;    //未通过的条数
                $(".countnum").html(count_no + " 条");
                loadhtml(data.item, 2);
            });
        }

        function loadhtml(data, tab) {
            var sysDate = new Date();
            $(data).each(function () {
                var logo = this.logo == null ? "img/30.png" : this.logo;
                var title = this.title;
                var titlelenth = 12;
                if (document.body.scrollWidth > 325) { titlelenth = 16; }
                if (title.length > titlelenth)
                    title = title.substr(0, titlelenth) + "...";
                var s = "";
                //分享未通过，重新上传
                if (tab == 2) {
                    if (this.is_pass == 3)
                        s = "审核中";
                    else
                        s = "<a href=\"makeshareupload_reset.html?id=" + this.id + "&money_id=" + this.money_id + "&article_id=" + this.article_id + "\">重新上传</a>";
                }
                else {
                    //分享通过,显示金额
                    s = "<img src=\"img/Makeimg/17.png\" />" + parseFloat(this.price).toFixed(2) + "元";
                    if (this.price == 0) {
                        if (Date.parse(sysDate) > GetMaxTime(this.date.substr(0, 16).replace("T", " ")))
                            s = "已失效";
                    }
                }
                $(".tg_select" + tab).append("<div class=\"centenlist\"><div class=\"centenimg\"><img src=\"" + logo + "\"></div><div class=\"cententxt\">" +
                    "<div class=\"cententxttop\" onclick=\"window.location.href='makeresultdetail.html?id=" + this.id + "&isad=0'\">" +
                    "<strong>" + title + "</strong></div>" +
                    "<div class=\"centenTime\">" + this.date.replace("T", " ").substr(0, 19) + "</div>" +
                    "<div class=\"Sharecentenflow\">" + s + "</div></div></div>");
            });
        }

        function GetMaxTime(date) {
            var d = new Date(date);
            d.setMinutes(30);  //30分钟失效
            return Date.parse(d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate() + " " + d.getHours() + ":" + d.getMinutes());
        }
    </script>
</body>
</html>
